package com.mezz.bones.im.logic.process.impl;

import com.mezz.bones.im.common.enums.ActionCodeEnum;
import com.mezz.bones.im.common.message.base.MessageHeader;
import com.mezz.bones.im.common.message.body.in.PrivateMessageRemoveReq;
import com.mezz.bones.im.common.domain.user.ImUserConnectInfo;
import com.mezz.bones.im.logic.process.interfaces.AbstractMessageLogicProcess;
import com.mezz.bones.im.logic.service.IChatPrivateMessageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @Author: zhuang
 * @Date: 2024/11/29 18:39
 * @Description: TODO
 * @Version: 1.0
 **/

@Service
public class PrivateMessageRemoveProcess extends AbstractMessageLogicProcess<PrivateMessageRemoveReq,Object> {

    @Resource
    private IChatPrivateMessageService privateMessageService;
    @Override
    public void preHandlerParam(ImUserConnectInfo senderUserConnectInfo, MessageHeader header, PrivateMessageRemoveReq req) {
        req.setUserId(senderUserConnectInfo.getUserId());
    }

    @Override
    public String tag() {
        return ActionCodeEnum.CLIENT_PRIVATE_MESSAGE_REMOVE.getCode();
    }

    @Override
    public Object process(ImUserConnectInfo senderUserConnectInfo, MessageHeader header, PrivateMessageRemoveReq req, Map<String,Object> context) {

        privateMessageService.userPrivateMessageRemove(req);
        return null;
    }


}
